/*
 *  Copyright (C) 2010 Zubanov Dmitry
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


/**
 *
 * @author Zubanov Dmitry aka javadimon, zubanov@gmail.com
 * Omsk, Russia, created 29.05.2010
 * (C) Copyright by Zubanov Dmitry
 */

package org.jssdb.core.josql;

public class WhereTreeNode {
    
    private String expression;
    private boolean isNode;
    private int parent;
    private boolean isLeftPart;
    private Object value, extObject;

    public WhereTreeNode(Object value, String expression, boolean isLeftPart,
            int parent, boolean isNode, Object extObject){
        this.value = value;
        this.expression = expression;
        this.parent = parent;
        this.isNode = isNode;
        this.isLeftPart = isLeftPart;
        this.extObject = extObject;
    }

    public void setExtObject(Object obj){
        this.extObject = obj;
    }

    public void setValue(Object obj){
        this.value = obj;
    }

    public String getExpression() {
        return expression;
    }

    public boolean isNode() {
        return isNode;
    }

    public int getParent() {
        return parent;
    }

    public Object getValue() {
        return value;
    }

    public boolean isIsLeftPart() {
        return isLeftPart;
    }

    public Object getExtObject() {
        return extObject;
    }


    @Override
    public String toString(){
        String str = "{" + value + ", " + expression + ", " + isLeftPart + ", " 
                + parent + ", " + isNode + ", " + extObject + "}";
        return str;
    }

}
